<?php

/*
 * MD_Controller class refers to MODULE CONTROLLER
 * all the controllers within a module should extend 
 * this class instead of MY_Controller class which should 
 * be used outside of the module (within the core application)
 */
class MD_Controller extends MY_Controller {
    
    function __construct()
    {
            parent::__construct();        
            /*
             * ********************************************
             * SETTINGS PACKAGE IS LOADED WITHIN 
             * THE CONSTRUCTOR OF THE PARENT CLASS!!!
             * ********************************************
             */
        
            $this->config->load('module_config');
            $this->config->load('module_theme');
            
            
            /* **********************************************************
             * LOAD THEME FOR MODULES THAT DO NOT HAVE THE THEME DISABLED
               ********************************************************** */
            if($this->config->item('disable_theme') != true)
            {
                /*
                * ********************************************
                * THEME SETTINGS COMMON FOR CURRENT MODULE
                * this method defines the following constants
                * 
                * 1) MODULE_THEME_PATH
                * 2) MODULE_JS_PATH
                * 3) MODULE_CSS_PATH
                * 4) MODULE_IMG_PATH
                * 5) MODULE_SITE_URL
                * ********************************************
                */            
                
                /*
                * ********************************************
                * RUN MODULE THEME SETUP
                * ********************************************
                */        
                $this->PACKAGE->core->settings->set_module_theme();   
            }
    }
    
}
?>
